set(PARSER_TEST_LIBS
    $<TARGET_OBJECTS:parser_obj>
    $<TARGET_OBJECTS:filter_obj>
    $<TARGET_OBJECTS:network_obj>
    $<TARGET_OBJECTS:fs_obj>
    $<TARGET_OBJECTS:time_obj>
    $<TARGET_OBJECTS:gflags_man_obj>
    $<TARGET_OBJECTS:schema_obj>
    $<TARGET_OBJECTS:meta_client>
    $<TARGET_OBJECTS:stats_obj>
    $<TARGET_OBJECTS:time_obj>
    $<TARGET_OBJECTS:meta_thrift_obj>
    $<TARGET_OBJECTS:storage_client>
    $<TARGET_OBJECTS:storage_thrift_obj>
    $<TARGET_OBJECTS:common_thrift_obj>
    $<TARGET_OBJECTS:thrift_obj>
    $<TARGET_OBJECTS:thread_obj>
    $<TARGET_OBJECTS:base_obj>
)

nebula_add_test(
    NAME
        parser_test
    SOURCES
        ParserTest.cpp
    OBJECTS
        ${PARSER_TEST_LIBS}
    LIBRARIES
        gtest
        gtest_main
        ${THRIFT_LIBRARIES}
        wangle
)

nebula_add_test(
    NAME
        scanner_test
    SOURCES
        ScannerTest.cpp
    OBJECTS
        ${PARSER_TEST_LIBS}
    LIBRARIES
        gtest
        gtest_main
        ${THRIFT_LIBRARIES}
        wangle
)

nebula_add_executable(
    NAME
        parser_bm
    SOURCES
        ParserBenchmark.cpp
    OBJECTS
        ${PARSER_TEST_LIBS}
    LIBRARIES
        follybenchmark
        boost_regex
        ${THRIFT_LIBRARIES}
        wangle
)

if(ENABLE_FUZZ_TEST)
    nebula_add_subdirectory(fuzzing)
endif()
